package section4_9;

import java.util.concurrent.Callable;

/**
 * Created by Hyman on 2017/6/8.
 *
 * 任务类，实现Callable接口，参数化为String类型
 */
public class Task implements Callable<String> {

    /**
     * 核心方法，输出任务执行时间
     *
     * @return 执行结果字符串
     * @throws Exception
     */
    @Override
    public String call() throws Exception {
        while (true){
            System.out.printf("Task: Test\n");
            Thread.sleep(100);
        }
    }
}
